#include<bits/stdc++.h>
#define ll long long 
using namespace std;
namespace IO{
    char buff[1<<21],*p1=buff,*p2=buff;
    char getch(){
        return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;
    }
    template<typename T>
    void read(T &x){
        char ch=getch();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    char obuf[1<<21],*p3=obuf;
    void putch(char ch){
        if(p3-obuf<(1<<21))*p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    void pc(const char *s){
    	while(*s)putch(*s),s++;
    }
    char ch[100];
    template<typename T>
    void write(T x){
        if(!x)return putch('0');
        if(x<0)putch('-'),x*=-1;
        int top=0;
        while(x)ch[++top]=x%10+48,x/=10;
        while(top)putch(ch[top]),top--;
    }
    template<typename T,typename ...Args>
    void write(T x,Args ...args){
        write(x),putch(' '),write(args...);
    }
    void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
const int N=2e5+5,V=2e5;
int n,a0;
struct node{
	int a,h;
}p[N];
int st[N],tot;
ll sum[N],f[N];
signed main(){
	freopen("xinyue.in","r",stdin);
	freopen("xinyue.out","w",stdout);
	read(n,p[0].a);
	for(int i=1;i<=n;i++)read(p[i].a,p[i].h);
	sort(p+1,p+n+1,[](node A,node B){return A.a==B.a?A.h<B.h:A.a<B.a;});
	ll tmp=0;
	for(int i=1;i<=n;i++){
		if(p[i].a<=p[0].a){
			tmp+=(((p[i].h+p[n].a-1)/p[n].a)-1)*p[i].a;
		}else{
			if(i==1||p[i].a!=p[i-1].a)st[++tot]=i;
			else tmp+=(((p[i].h+p[n].a-1)/p[n].a)-1)*p[i].a;
		}
	}
	for(int i=1;i<=tot;i++)sum[i]=sum[i-1]+(((p[st[i]].h+p[n].a-1)/p[n].a)-1)*p[st[i]].a;
	memset(f,0x3f,sizeof f);f[0]=0;
	for(int i=1;i<=tot;i++){
		for(int j=0;j<i;j++)
			f[i]=min(f[i],f[j]-sum[j]+1ll*((p[st[i]].h+p[st[j]].a-1)/p[st[j]].a)*p[st[i]].a);
		f[i]+=sum[i-1]-p[st[i]].a;
	}
	write(f[tot]+tmp);
	flush();
	return 0;
}/*
4 1
3 2
4 4
5 6
1 6

*/

